<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>
<SCRIPT type="text/javascript">
    <!--
    var formSetting0 = {
    		po:'MathWinxbind',
    		type:"query",
    		hiddens:["id"],
    	fields:[[{title:"手机号",type:"text",name:"txtmobile"},{title:"名称",type:"text",name:"txtname"}
    	  ]
    	],
    	queryRow:{align:'center',buttons:[
		                 			   {
		                 			    	 id:'query',
		                 			    	 title:'查询',
		                 			    	 handlers:{
		                 			    		 click: function(e,queryForm){
		                 			    			 queryData(e,queryForm);
		                 			    		 }
		                 			    	 }
		                 			     }, {
		                 			    	 id:'resetbtn',
		                 			    	 title:'重置',
		                 			    	 handlers:{
		                 			    		 click: function(){
		                 			    			 form0.reset();
		                 			    		 }
		                 			    	 }
		                 			     }
		                 			 ]}
    }

    function queryData(e,queryForm){
    	var txtmobile = queryForm.find(":input[name=txtmobile]").val();
        var txtname = queryForm.find(":input[name=txtname]").val();
    	var data = [];
    	if(txtmobile!==""){
    		data.push({or:[{r:"like",name:'jGMobi',value:"%"+txtmobile+"%"},{r:"like",name:'parMobi',value:"%"+txtmobile+"%"},{r:"like",name:'terMobi',value:"%"+txtmobile+"%"}]});
    	}
    	if(txtname!==""){
            data.push({or:[{r:"like",name:'wNum',value:"%"+txtname+"%"},{r:"like",name:'wName',value:"%"+txtname+"%"}]});
        }

    	grid.load({data:data});
    	ajustHeight();
    }
	var gridSetting = {
			id:'MathWinxbindGrid',
			po:"MathWinxbind",
			title:'微信列表',
			height:'auto',
			service:"uiServices!listSimple",
			hideCheckbox:true,
			pageInfo: {
				records: 12,//auto表示根据容器高度自动判断
				orderby : "id"
			},
            oper:{
                isDisplay:true,
                operName:"清除绑定",
                url:""
            },
			fields:[
			   {	name:'id',
					hide:true
			   },{
                	name: 'openid',
                	descs:"openid",
                	align:'left'
               }
			   ,{
				   name: 'wName',
				   descs:"昵称",
				   align:'left',
				   width:100
			   }
			   ,{
               	   name: 'jGMobi',
               	   descs:"机构手机",
               	   align:'left',
               	   width:105
               }
               ,{
                   name: 'parMobi',
                   descs:"家长手机",
                   align:'left',
                   width:105
               }
               ,{
                   name: 'terMobi',
                   descs:"教师手机",
                   align:'left',
                   width:105
               }
			   ,{
               	   name: 'jgCreateDateTime',
               	   descs:"机构绑定时间",
               	   align:'left',
               	   width:150
               }
               ,{
                   name: 'parCreateDateTime',
                   descs:"家长绑定时间",
                   align:'left',
                   width:150
               }
               ,{
                   name: 'terCreateDateTime',
                   descs:"教师绑定时间",
                   align:'left',
                   width:150
               }
			]
		};
	var grid,form0;
    $(document).ready(function(){
    	form0 = new FormView("formview0",formSetting0);
    	form0.init();
    	grid = new GridView("list",gridSetting,"list");
		grid.init();
		grid.load();

		ajustHeight();
    });
    function clearbind(id){
       $.getJSON(g_path+"/public/common/clearBind.htmls",{id:id},function(data){
          grid.reload();
       });
    }
    //-->
</SCRIPT>
</head>

<body>
<div id="formview0" class="rbox1"></div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>
<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
</body>
</html>